package muse.frames;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import muse.Frame;
import muse.Launcher;
import muse.widgets.ChatBubbleWidget;
import muse.widgets.MuseWidget;
import muse.widgets.OrbPanel;
import muse.widgets.TextboxWidget;

public class Customize extends Frame {

    JPanel optionsPane;
    TextboxWidget textPane;
    MuseWidget musePane;
    
    public Customize()
    {
        
        /*
        this.setLayout(new BorderLayout());
        JPanel all = new JPanel();
        JPanel top = new JPanel();
        JPanel bot = new JPanel();
        
        all.setLayout(new GridLayout(2,1,5,5)); //2 rows, 1 col, xpad, ypad
        all.add(top);
        all.add(bot);
        
        String[] opts = {"Option 1", "Option 2", "Option 3", "Option 4", "Back"};	
        JComboBox jcb = new JComboBox(opts);
        
        optionsPane = new JPanel();
        optionsPane.add(jcb);
        optionsPane.setBorder(BorderFactory.createLineBorder(Color.green));
        
        JButton temp = new JButton("char cust");
        temp.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						Launcher.getWindow().changeScreen(MFrame.CHARACTERCUSTOMIZE);
					}
				});
        optionsPane.add(temp);
        
        musePane = new MuseWidget();
        musePane.setBorder(BorderFactory.createLineBorder(Color.blue));
        
        textPane = new TextboxWidget();
      
        top.setLayout(new GridLayout(1,2,5,5));
        top.add(musePane);
        top.add(optionsPane);
        
        bot.setBorder(BorderFactory.createLineBorder(Color.black));
        bot.add(textPane);

        bot.setBorder(BorderFactory.createLineBorder(Color.red));
        this.add(all);
        
      
        */
        
        
        
        //##--##--##--##--##--##--##--##--##--##--####
        //--                                        ##
        //##                                        ##
        //------------------------------------------##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //------------------------------------------##
        //##                    --                  ##
        //--                    --                  ##
        //##                    --                  ##
        //--                    --                  ##
        //##                    --                  ##
        //------------------------------------------##
        
        //initialize the base layer panel
        this.setLayout(new BorderLayout());
        this.setOpaque(false);
        JPanel base_layer = new JPanel();
        base_layer.setLayout(new GridBagLayout());
        base_layer.setOpaque(false);
        GridBagConstraints c = new GridBagConstraints();
        
        //Build each of the level two layers        
        JPanel panel_orbs_000      = new OrbPanel();
        panel_orbs_000.setBorder(BorderFactory.createLineBorder(Color.pink  ));
        panel_orbs_000.setOpaque(false);
        panel_orbs_000.setPreferredSize(new Dimension((int)(getWidth()*1.00), (int)(getHeight()*0.10)));
        
        JPanel panel_introArea_001 = new JPanel();
        panel_introArea_001.setBorder(BorderFactory.createLineBorder(Color.green));
        panel_introArea_001.setOpaque(false);
        panel_introArea_001.setPreferredSize(new Dimension((int)(getWidth()*1.00), (int)(getHeight()*0.60)));
        
        JPanel panel_muse_002      = new MuseWidget();
        panel_muse_002.setBorder(BorderFactory.createLineBorder(Color.blue));
        panel_muse_002.setOpaque(false);
        panel_muse_002.setPreferredSize(new Dimension((int)(getWidth()*0.50), (int)(getHeight()*0.30)));
        
        JPanel panel_museChat_003  = new ChatBubbleWidget();
        panel_museChat_003.setBorder(BorderFactory.createLineBorder(Color.red));
        panel_museChat_003.setOpaque(false);
        panel_museChat_003.setPreferredSize(new Dimension((int)(getWidth()*0.50), (int)(getHeight()*0.30)));
        
        JButton temp = new JButton("char cust");
        temp.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						Launcher.getWindow().changeScreen(MFrame.CHARACTERCUSTOMIZE);
					}
				});
        
        //Add each of the level two layers to the base layer  
        c.fill = GridBagConstraints.BOTH;
        c.gridx     = 0;    c.gridy      = 0;
        c.gridwidth = 10;   c.gridheight = 1;
        c.ipadx     = 0;    c.ipady      = 0;
        c.weightx   = 1.0;  c.weighty    = 1;
        c.insets = new Insets(0, 0, 0, 0);
        base_layer.add(panel_orbs_000, c);
        
        c.fill = GridBagConstraints.BOTH;
        c.gridx     = 0;    c.gridy      = 4;
        c.gridwidth = 10;   c.gridheight = 6;
        c.ipadx     = 0;    c.ipady      = 0;
        c.weightx   = 1.0;  c.weighty    = 6;
        c.insets = new Insets(0, 0, 0, 0);
        base_layer.add(panel_introArea_001, c);
        
        c.fill = GridBagConstraints.BOTH;
        c.anchor = GridBagConstraints.CENTER;
        c.gridx     = 0;    c.gridy      = 1;
        c.gridwidth = 5;    c.gridheight = 3;
        c.ipadx     = 0;    c.ipady      = 0;
        c.weightx   = 0.5;  c.weighty    = 3;
        c.insets = new Insets(0, 0, 0, 0);
        base_layer.add(panel_muse_002, c);
        
        c.fill = GridBagConstraints.BOTH;
        c.gridx     = 5;    c.gridy      = 1;
        c.gridwidth = 5;    c.gridheight = 3;
        c.ipadx     = 0;    c.ipady      = 0;
        c.weightx   = 0.5;  c.weighty    = 3;
        c.insets = new Insets(0, 0, 0, 0);
        base_layer.add(panel_museChat_003, c);

        //add temp button to the museChat panel
        panel_museChat_003.setLayout(new FlowLayout());
        panel_museChat_003.add(temp);
        
        //add the base layer
        this.add(base_layer);  
        
    }
}
